home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
apps
/
astronmy
/
noradsc.arc
/
norad.lst
next >
Wrap
File List
|
1990-06-07
|
35KB
|
1,078 lines
REM N.O.R.A.D. V2.0 The graphic realtime satellite tracking program.
REM ATARI ST -- GFA BASIC 3.07
REM Please customize the six lines below.
REM
tlocal=-5 ! Your time difference from GMT (UTC). i.e. -5 = CDT
l9=45.0709 ! Your latitude, degrees.fraction-of-degrees.
w9=93.1567 ! Your longitude, degrees.fraction. i.e +values for USA
h9=980 ! Your altitude above sea-level. (Feet)
el$="C:\orbitals.dat" ! Path to orbital elements file. (NASA Predictions)
ms=2000 ! Maximum number of satellites. (To reserve space)
REM
MODE 1 ! GFA Basic 3.07 compiler default override.
REM
REM Orbital calculation subroutines from the AMSAT Orbital Prediction Program
REM (C) 1980 by Dr. T. A. Clark W3IWI, 6388 Guilford Road, Clarksville MD
REM 21209 USA. "Permission granted for non-commercial use provided credit is
REM given to author, AMSAT and ORBIT magazine. See ORBIT issue 6, March/
REM April 1981. Ported to ATARI ST BASIC by Scott Tilley (1/24/87.)
REM
REM Graphic interface and world map by John Logajan, 4248 Hamline, Arden Hills
REM MN 55112 USA. 6/3/90 Graphic interface and map code are released into
REM the public domain. logajan@ns.network.com john@logajan.mn.org
REM
CLS
h9=h9*12/39.37 ! convert feet height to meters
REPEAT
REPEAT
DEFTEXT 3,0,0,32
TEXT 100,25,0,"Welcome to N.O.R.A.D. V2"
DEFTEXT 1,0,0,13
TEXT 105,45,0,"Your clock said the time was: "+DATE$+" "+TIME$
DEFTEXT 2,0,0,13
TEXT 100,61,0,"Please be sure it is set to the EXACT time and date!"
TEXT 175,152,0,"Press the HELP-key for instructions."
TEXT 220,170,0,"Press the ESC-key to exit."
TEXT 80,186,0,"- Point at satellite of interest and click to get its info -"
a$="Want to set/reset the clock?"
ALERT 2,a$,1,"No need|SetClock|Quit!",but
IF but=3
EDIT
ENDIF
IF but=2
CLS
PRINT "Enter date (or RETURN to skip)"
PRINT
PRINT "Use the format month/day/year."
PRINT "Be sure to use two digits (leading zeroes) for each."
PRINT "Otherwise the system will ignore the new date."
PRINT
PRINT DATE$;
INPUT " Date ";d$
CLS
PRINT "Enter local time (or RETURN to skip)"
PRINT
PRINT "Use the format hour:minute:second."
PRINT "Be sure to use two digits (leading zeroes) for each."
PRINT "Otherwise the system will ignore the new time."
PRINT
PRINT TIME$;
INPUT " Time ";t$
SETTIME t$,d$
ENDIF
CLS
UNTIL but=1
y=VAL(RIGHT$(DATE$,4))-1900
IF y<89
PRINT " Is it really the year ";1900+y;" ?"
PRINT "I haven't made the program so it can work in years before 1989,"
PRINT "so I am going to force you to set your clock/calender."
ALERT 1," ",1,"continue",but
CLS
ENDIF
UNTIL y>=89
IF y/4=INT(y/4)
f9=1
ELSE
f9=0 ! leap-year flag
ENDIF
d=VAL(MID$(DATE$,4,2))
m=VAL(LEFT$(DATE$,2))
REM Calculate day of year
DATA 0,31,59,90,120,151,181,212,243,273,304,334
FOR i=1 TO 12
READ d9x
IF i=m
d9=d9x
ENDIF
NEXT i
d8=d+d9
IF m>2
d8=d8+f9
ENDIF
t$=TIME$
tstart=TIMER
h=VAL(LEFT$(t$,2))
s=VAL(RIGHT$(t$,2))
m=VAL(MID$(t$,4,2))
t7=d8+h/24+m/1440+s/86400-tlocal/24
leapy=30/60/60/24
r0=6378.135 ! earth mean diameter km
f=298.25 ! delta diameter km
f=1/f
g0=75369793000000 ! gravitational constant
g1=1.0027379093 ! sidereal/solar ratio
p2=2*PI
p0=PI/180
pd2=PI/2
pday=p2/365.2422 ! 2*pi/days per year
seg=279.04247*p0 ! sun's ecliptic longitude at 1975
swg=282.510396*p0 ! sun's ecliptic longitude at perigee
see=0.01672*2 ! eccentricy of earth orbit
sepoch=5114 ! days between 1975 and 1989 (my base year)
obliq=23.4333333*p0 ! obliquity of the ecliptic
cobliq=COS(obliq)
sobliq=SIN(obliq)
cl9p0=COS(l9*p0)
sl9p0=SIN(l9*p0)
dseg=seg-swg
ltsun=0
w9x=w9/15
REM Greenwich Sidereal Time at New Year's
yt%=0
FOR y1=90 TO y
yd%=365
IF y1/4=INT(y1/4)
yd%=366
ENDIF
yt%=yt%+yd%
NEXT y1
g2=FRAC(yt%*g1+0.27676779) ! Figure forward from 0.0.1989 GMT
sepoch=sepoch+yt%
REM Routine to evaluate OBSERVER's GEOCENTRIC Coordinates, where
REM X-axis=GREENWICH, Y-axis goes thru India, Z-axis=North Pole
l8=l9*p0
s9=SIN(l8)
c9=COS(l8) ! Initial GEOCENTRIC coordinates
s8=SIN(-w9*p0)
c8=COS(w9*p0) ! W9= West longitude
REM Now to account for flattened Earth
r9=r0*(1-(f/2)+(f/2)*COS(2*l8))+h9/1000 ! H9=height in meters
REM Now to make L8 the GEOCENTRIC latitude
l8=ATN((1-f)^2*s9/c9)
z9=r9*SIN(l8)
x9=r9*COS(l8)*c8
y9=r9*COS(l8)*s8
REM *********** get Parameters for Satellites *********
PRINT "Reading orbital elements from file: ";el$
PRINT
ON ERROR GOSUB missing
OPEN "I",#1,el$
msx%=LOF(#1)/141
IF msx%<ms
ms=msx%
ENDIF
DIM c(3,2),lvt%(200),s$(ms),y3(ms),t0(ms),mmr(ms),i0(ms),o0(ms),e0(ms)
DIM w0(ms),m0(ms),n0(ms),k0(ms),a0(ms),xx%(ms),yy%(ms),e(ms),prob|(ms)
sp%=0
ON ERROR GOSUB baddy
DO
EXIT IF EOF(#1)
LINE INPUT #1,ln$
EXIT IF EOF(#1)
LINE INPUT #1,l1$
EXIT IF EOF(#1)
LINE INPUT #1,l2$
WHILE LEFT$(l1$,1)<>"1" OR LEFT$(l2$,1)<>"2"
ln$=l1$
l1$=l2$
EXIT IF EOF(#1)
LINE INPUT #1,l2$
WEND
INC sp%
s$(sp%)="[ ]"
MID$(s$(sp%),2,14)=LEFT$(ln$,14)
MID$(s$(sp%),17,5)=MID$(l1$,3,5)
y3(sp%)=VAL(MID$(l1$,19,2))
t0(sp%)=VAL(MID$(l1$,21,12))
IF y3(sp%)<y ! Correct for "old" orbital elements
yt%=0
FOR y1=y3(sp%) TO y-1
yd%=365
IF y1/4=INT(y1/4)
yd%=366
ENDIF
yt%=yt%+yd%
NEXT y1
t0(sp%)=t0(sp%)-yt%
y3(sp%)=y
ENDIF
mmr(sp%)=VAL(MID$(l1$,34,10))
i0(sp%)=VAL(MID$(l2$,9,8))
o0(sp%)=VAL(MID$(l2$,18,8))
e0(sp%)=VAL("."+MID$(l2$,27,7))
w0(sp%)=VAL(MID$(l2$,35,8))
m0(sp%)=VAL(MID$(l2$,44,8))
n0(sp%)=VAL(MID$(l2$,53,11))
k0(sp%)=VAL(MID$(l2$,64,5))
a0(sp%)=((g0/(n0(sp%)^2))^(1/3))
e(sp%)=0
PRINT sp%;TAB(5);s$(sp%)
IF sp%=ms
PRINT "Oops! Not enough room reserved for all satellite elements."
PRINT "Increase the variable -Ms- to a higher number and try again."
EDIT
ENDIF
IF INP?(2)
IF INP(2)=27
EDIT
ENDIF
ENDIF
LOOP
ON ERROR
IF sp%=0
GOSUB missing
ENDIF
CLOSE #1
mxsp%=sp%-1
mxsps%=sp%
FOR i%=1 TO mxsp%
prob|(i%)=0
NEXT i%
nowreck!=FALSE
IF FRE(0)>50000
nowreck!=TRUE
DIM helparray%(33000/4)
helpstuff%=INT(VARPTR(helparray%(0))/256)*256+256
keepalive%=XBIOS(2)
ENDIF
REM ******** Here follows the actual computation loop *********
CLS
SETCOLOR 0,0,0,0 ! For color 0 (black -- background)
SETCOLOR 1,0,0,7 ! For color 2 (blue -- trails)
SETCOLOR 3,7,0,0 ! For color 1 (red -- satellites/text/arrow)
SETCOLOR 2,3,2,0 ! For color 3 (brown -- world map)
DEFMOUSE 0
DEFFILL 3,1
white!=FALSE
hilite!=FALSE
facts!=FALSE
clkon!=FALSE
clkfast!=FALSE
mapon!=TRUE
equat!=FALSE
helpme!=FALSE
lookup!=FALSE
found!=FALSE
sunfacts!=FALSE
sunchk!=FALSE
radaron!=FALSE
leaptime!=FALSE
vpage%=0
d$=CHR$(248)
GOSUB map
DO
GOSUB sun
IF sunfacts!
GOSUB factsun
ENDIF
FOR sp%=1 TO mxsp%
IF (NOT radaron!) OR (radaron! AND prob|(sp%)<1)
t=t7+(TIMER-tstart)/17280000
GOSUB fnc
COLOR 2
IF hilite!
IF sp%=sr%
COLOR 1
ENDIF
ENDIF
PLOT xx%(sp%),yy%(sp%)
COLOR 1
IF sunchk! AND ((NOT radaron!) OR (radaron! AND e9>0))
gcca=COS((sunlng-wx5-180)*p0)
gcsatc=(90-l5)*p0
gcangle=(ACOS(gcbcos*COS(gcsatc)+gcbsin*SIN(gcsatc)*gcca))/p0
IF gcangle>90
shad=r*COS((gcangle-90)*p0)
IF shad<r0
COLOR 2
ENDIF
ENDIF
ENDIF
IF radaron!
IF e9=>0
rrr=90-e9
yy%(sp%)=100-rrr*COSQ(a9)
xx%(sp%)=2.4*rrr*SINQ(a9)+320
PLOT xx%(sp%),yy%(sp%)
ENDIF
ELSE
yy%(sp%)=1.11111111*(90-l5)
xx%(sp%)=1.77777777*(360-wx5)
PLOT xx%(sp%),yy%(sp%)
ENDIF
ELSE
DEC prob|(sp%)
ENDIF